package com.bs.elasticsearch.vo;

import lombok.Builder;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author bingshao
 * @date 2023/3/17
 **/
@Data
@Document(indexName = "goods", createIndex = false)
@Builder
public class GoodsVo implements Serializable {
    private static final long serialVersionUID = 6374726253460087442L;

    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    @Field(type = FieldType.Integer)
    private Integer salesVolume;

    @Field(type = FieldType.Double)
    private Double price;

    @Field(type = FieldType.Text, index = false)
    private String description;

    @Field(type = FieldType.Text, index = false)
    private String image;

    @Field(type = FieldType.Integer, index = false)
    private Integer status;

    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private Date updateTime;

    @Field(type = FieldType.Keyword)
    private String catalog1;

    @Field(type = FieldType.Keyword)
    private String catalog2;
}
